package com.aspire.boc.mms.gwcmp.util;

import javax.servlet.http.HttpServletRequest;

import com.aspire.boc.mms.wmf.cam.Admin;
import com.aspire.boc.mms.wmf.model.SecurityUser;
/**
 * 获取当前登录人的相关信息
* @ClassName: GwcmpAdminUtil 
* @Description: TODO(这里用一句话描述这个类的作用) 
* @author zhouzhendong
* @date 2016年1月18日  
*
 */
public class GwcmpAdminUtil {
	
    /**
     * 获取当前登录人
     * @param request
     * @return
     */
	public static Admin getLoginUser(HttpServletRequest request) {
	    
		SecurityUser securityUser = (SecurityUser) request.getSession().getAttribute("securityUser");
		String loginName = securityUser.getLoginName();
		Admin admin = new Admin();
		admin.setAdminName(loginName);
	    return admin;
    }
	
	/**
     * 获取当前登陆名
     * @param request
     * @return
     */
	public static String getLoginUserName(HttpServletRequest request) {		
	    
		return getLoginUser(request).getAdminName();
    }
	
	
}
